#ifndef CARUI_H
#define CARUI_H
#include"workui.h"
#include <QMainWindow>
#include"mapwidget.h"
#include<QtNetwork/QUdpSocket>
#include<QtNetwork/QNetworkDatagram>

namespace Ui {
class Carui;
}

class Carui : public QMainWindow
{
    Q_OBJECT

public:
    void closeEvent(QCloseEvent *event);
    explicit Carui(QWidget *parent ,QString nn,QString id,QUdpSocket* udp);
    ~Carui();
    void changeposact();
    QPoint orderstart;
    QPoint orderfinal;
    void getroad(QPoint nowlocal,QPoint finallocal);
   // QTimer* tm;
    QPoint next;
    QQueue<QPoint> rd;
    QPoint lc;
    QTimer* tm;
    int flag=0;
    QPair<int, int> findBoundingGridPointIndices(const QPoint& targetPoint, const QVector<QPoint>& gridPoints, int xTolerance, int yTolerance);
private slots:
    void on_locationButton_9_clicked();
    void Udphandle();
    void on_locationButton_10_clicked();
    void changeorder();

private:
    Ui::Carui *ui;
    QString name;
    QUdpSocket* udp;
    QString ID;
    QString orderid;
};

#endif // CARUI_H
